package com.ruoyi.repay.controller;



import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.repay.domain.AlipayBean;
import com.ruoyi.repay.service.AlipayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("repay")

public class AlipayController {
    @Autowired
    private AlipayService alipayService;
    @RequestMapping("pay")
    public AjaxResult alipayPay(@RequestBody AlipayBean alipayBean)throws Exception{
        return AjaxResult.success(alipayService.alipayPay(alipayBean));
    }

    @RequestMapping("query")
    public String query(String out_trade_no) throws Exception{
        return alipayService.queryOrder(out_trade_no);
}
}
